package top.fullj.remoting.consumer;

import java.lang.reflect.Proxy;

/**
 * @author bruce.wu
 * @since 2022/2/14 10:56
 */
public class Stub {

    @SuppressWarnings("unchecked")
    public static <T> T create(Class<T> type) {
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        return (T) Proxy.newProxyInstance(classLoader,
                new Class<?>[] {type}, new ClientStub());
    }

}
